SET SERVEROUTPUT ON;
DECLARE

--Declaring the variables for storing the data from the cursor.
ask_table_name dba_triggers.trigger_name%TYPE;
owner_name dba_triggers.owner%TYPE;
trigger_name dba_triggers.trigger_name%TYPE;
trigger_type dba_triggers.trigger_type%TYPE;
trigger_event dba_triggers.triggering_event%TYPE;
   
   --Creating the Cursor to get the details from dba_triggers
   CURSOR trigger_details IS 
   SELECT owner, trigger_name, trigger_type, triggering_event 
   FROM dba_triggers 
   WHERE table_name = ask_table_name;

BEGIN
	--Prompting the users to enter the Oracle Internal table name
   ask_table_name := '&Table_Name';
   OPEN trigger_details;
   LOOP
	FETCH trigger_details INTO owner_name,trigger_name,trigger_type,trigger_event;
	EXIT WHEN trigger_details%NOTFOUND;
	
	--Displaying the Details of the Particular data found for Table name
	DBMS_OUTPUT.PUT_LINE('TriggerOwner' ||'    '|| 'Trigger_Name'||'  '|| 'Trigger_Type'||'  '|| 'Triggering_Event');
	DBMS_OUTPUT.PUT_LINE('--------------------------------------------------------------------------------');
	DBMS_OUTPUT.PUT_LINE(owner_name||'  '||trigger_name||'     '||trigger_type||'     '||trigger_event);
  END LOOP;
  CLOSE trigger_details;
END;
/
